package com.A01.sys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 页面控制器，控制不同html页面的转换
 */
@Controller
public class PageController {

    /**
     * 登录页面
     * @return “login"
     */
    @RequestMapping("/")
    public Object login() {
        return "login";
    }

    @RequestMapping("/user")
    public Object user() {
        return "modules/sys/user";
    }

    @RequestMapping("/index")
    public Object index2() {
        return "index";
    }

    @RequestMapping("index.html")
    public Object index() {
        return "index";
    }

    @RequestMapping("register.html")
    public Object register() {
        return "register";
    }

    @RequestMapping("main.html")
    public String main() {
        return "main";
    }

    @RequestMapping("modules/{url}.html")
    public String module(@PathVariable("url") String url) {
        return "modules/" + url;
    }

    @RequestMapping("modules/{module}/{url}.html")
    public String module2(@PathVariable("module") String module, @PathVariable("url") String url) {
        return "modules/" + module + "/" + url;
    }
}
